package com.buaa.pm.controller;

import com.buaa.pm.entity.OssFile;
import com.buaa.pm.model.ResultModel;
import com.buaa.pm.service.OssFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    private OssFileService ossFileService;

    @GetMapping("/download")
    public ResponseEntity<byte[]> downloadFile(@RequestParam String id) {
        return ossFileService.download(id);
    }

}
